package eg.com.itiga.ui.beans;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import eg.com.itiga.business.base.BaseService;
import eg.com.itiga.business.exception.BusinessException;
import eg.com.itiga.business.factory.BusinessFactory;
import eg.com.itiga.business.itian.BranchService;
import eg.com.itiga.business.itian.DepartmentService;
import eg.com.itiga.domain.*;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

public class AddITIianFormBean extends org.apache.struts.action.ActionForm {

	private String fullName;
	private String email;
	private String phone;
	private Integer Intake;
	private Integer branch;
	private Integer department;
	private List<Branch> branches;
	private List<Department> departments;
	private Integer faculty;
	private Integer university;
	private List<Faculty> faculties;
	private List<University> universities;	
	
	private static BaseService baseService;
	
	static{
		try{
		baseService= BusinessFactory.createBaseService();
		}catch(Exception ex){
			ex.printStackTrace();
		}
	}
	
    public Integer getFaculty() {
		return faculty;
	}

	public void setFaculty(Integer faculty) {
		this.faculty = faculty;
	}

	public Integer getUniversity() {
		return university;
	}

	public void setUniversity(Integer university) {
		this.university = university;
	}

	public List<Faculty> getFaculties() {
		try {    		
    		faculties=baseService.findAll(Faculty.class);
		} catch (BusinessException e) {
			e.printStackTrace();
		}		
		return faculties;
	}

	public void setFaculties(List<Faculty> faculties) {
		this.faculties = faculties;
	}

	public List<University> getUniversities() {
		try {    		
    		universities=baseService.findAll(University.class);
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		
		return universities;
	}

	public void setUniversities(List<University> universities) {
		this.universities = universities;
	}

	public List<Branch> getBranches() {
    	
    	try {
    		
			branches=baseService.findAll(Branch.class);
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		return branches;
	}

	public void setBranches(List<Branch> branches) {
		this.branches = branches;
	}

	public List getDepartments() {
		try {
			
			departments=baseService.findAll(Department.class);
		} catch (BusinessException e) {
			e.printStackTrace();
		}
		return departments;
	}

	public void setDepartments(List<Department> departments) {
		this.departments = departments;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getIntake() {
		return Intake;
	}

	public void setIntake(Integer intake) {
		Intake = intake;
	}

	public Integer getBranch() {
		return branch;
	}

	public void setBranch(Integer branch) {
		this.branch = branch;
	}

	public Integer getDepartment() {
		
		return department;
	}

	public void setDepartment(Integer department) {
		this.department = department;
	}

	public AddITIianFormBean () {
    }

    public void reset(ActionMapping actionMapping, HttpServletRequest request) {
        // TODO: Write method body
    	
    	return ;
    }

    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
        // TODO: Write method body
        return null;
    }


}